package com.heima.utils.thread;

import com.heima.model.user.pojos.ApUser;

public class ApThreadLocalUtil {

    private static final ThreadLocal<ApUser> WM_USER_THREAD_LOCAL = new ThreadLocal<>();


    //存入用户到threadlocal
    public static void setUser(ApUser apUser){
        WM_USER_THREAD_LOCAL.set(apUser);
    }

    //获取用户
    public static ApUser getUser(){
        return WM_USER_THREAD_LOCAL.get();
    }

    //清理
    public static  void clear(){
        WM_USER_THREAD_LOCAL.remove();
    }
}
